﻿using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

namespace Directory.Web
{
	public partial class Admin_Controls_ItemView : System.Web.UI.UserControl
	{
		protected void Page_Load(object sender, EventArgs e)
		{

			if (!WebUtil.IsCurrentUserInRole(WebSettings.GetInstance().CategoryAdminRole))
			{
				this.Controls.Clear();
				this.Visible = false;
			}

			this.CategoryTree.UserName = Page.User.Identity.Name;
			this.CategoryTree.Target = this.Target;

			if (this.CategoryTree.RootsCount > 0)
			{
				this.RolePanel.Visible = true;
			}
		}

		private string _target;
		public string Target
		{
			get { return _target; }
			set { _target = value; }
		}
	}
}